#!/bin/bash

rsync -avz \
  --exclude='.git' \
  --exclude='.env' \
  --exclude='.idea' \
  --exclude='runtime' \
  --delete \
  /home/aether/work/hyperf_data/ \
  root@192.168.28.199:/www/wwwroot/dhd_hyperf/hyperf_data/

# 执行成功后提示
if [ $? -eq 0 ]; then
  echo "------------------------"
  echo "同步完成！代码已部署到服务器"
else
  echo "------------------------"
  echo "同步失败，请检查错误信息"
fi
